package com.sf.pda;

import com.sf.config.AppConfig;
import com.sf.utils.UtilsLog;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;

public abstract class BaseActivity extends Activity {

	private MyBroadCastReceiver myReceiver;
	protected Context mContext;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		myReceiver = new MyBroadCastReceiver();
		IntentFilter filter = new IntentFilter(AppConfig.FINISH);
		registerReceiver(myReceiver, filter);
	}

	public class MyBroadCastReceiver extends BroadcastReceiver {

		@Override
		public void onReceive(Context context, Intent intent) {

			UtilsLog.e("==接受广播杀掉activity==", "==test==");
			finish();
		}

	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		unregisterReceiver(myReceiver);
	}

}
